#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  iterator.py
#       Author @  Huoty
#  Create date @  2016-05-17 20:24:41
#  Description @  
# *************************************************************

class Zrange:
    def __init__(self, n):
        self.n = n
        
    def __iter__(self):
        return self.__generator()

    def __generator(self):
        i = 0
        while i < self.n:
            yield i
            i += 1

# Script starts from here

zrange = Zrange(10)
print [i for i in zrange]
print [i for i in zrange]
